package com.example.demo.web;

import com.example.demo.service.IAqiService;
import com.example.demo.pojo.Aqi;
import com.example.demo.vos.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/aqi")
@CrossOrigin("*")
public class AqiWeb {

    @Autowired
    private IAqiService aqiService;

    @GetMapping("/{id}")
    public ResultVo getAqiById(@PathVariable("id") Integer aqiId) {
        return aqiService.getAqiById(aqiId);
    }

    @GetMapping("/listAqiAll")
    public ResultVo listAqiAll() {
        return aqiService.listAqiAll();
    }

}
